clear
set more off
cd ""

use "Crime.dta", replace
gen type = "drug" if inlist(OffenseCd, 7) == 1
replace type = "property" if inlist(OffenseCd, 2, 4, 10, 11, 12, 19) == 1
replace type = "violent" if inlist(OffenseCd, 3, 9, 14, 20) == 1
replace type = "other" if inlist(OffenseCd, 1, 5, 6, 8, 13, 15, 16, 17, 18, 21, 22) == 1
ta type Lawclass /// <- Cross tab is Table A3.

gen year = year(Date)
gen misd_assault = OffenseCd == 3
gen fel_assault = OffenseCd == 9
gen robbery = OffenseCd == 20
gen murder = OffenseCd == 14
collapse (sum) misd_assault fel_assault robbery murder, by(year)

label var misd_assault "Misd. Assault"
label var fel_assault "Felony Assault"
label var robbery "Robbery"
label var murder "Homicide"

graph twoway line misd_assault fel_assault murder robbery year /// <- Line graph is Figure A1 Panel B.
